<template>
  <div>
      <el-button plain @click="logout">退出</el-button>
  </div>
</template>

<script>
export default {
  name: "Index.vue",
  created() {
    const token = this.$route.params.token;
    const session = window.sessionStorage.getItem("token");
    if (session !== token) {
      this.$router.push("/");
    }
  },
  methods: {
    logout() {
      window.sessionStorage.clear();
      this.$router.push("/");
    },
  },
};
</script>

<style>
</style>